﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GroupPermission.aspx.cs"
    Inherits="Main_Utilities_GroupPermission" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>User Permissions</title>
    <link href="../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
    <%-- <script src="../../Menu/js/jquery.min.js" type="text/javascript"></script>--%>
    <script src="../../JavaScript/ModalPopups.js" type="text/javascript"></script>
    <script src="../../JavaScript/jquery-1.4.2.min.js" type="text/javascript"></script>
    <link href="../../Styles/HorizontalTab.css" rel="stylesheet" type="text/css" />
    <script src="../../JavaScript/HorizontalTab.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        function ModalPopupsWait() {
            ModalPopups.Indicator("idIndicator2",
            "Please wait",
            "<div style=''>" +
            "<div style='float:left;'><img src='../../Images/spinner.gif'></div>" +
            "<div style='float:left; padding-left:10px;'>" +
            "Saving User Permission... <br/>" +
            "This may take few seconds." +
            "</div>",
            {
                width: 300,
                height: 100
            }
            );
            setTimeout('ModalPopups.Close(\"idIndicator2\");', 3000);
        }

        function ModalPopupsAlert() {
            ModalPopups.Alert("jsAlert1",
           document.getElementById("hidHeading").value,
           "<div style='padding:10px; width:150px;'>" + document.getElementById("hidMessage").value + "</div>",
          {
              okButtonText: "OK"
          }
        );
        }
        function ShowAlert(msg) {
            alert(msg);
        }
        function getChecked(chkMain1, chkNew1, chkEdit1, chkDelete, chkPrint, ctl) {
            var chkMain = document.getElementById(chkMain1);
            var chkNew = document.getElementById(chkNew1);
            var chkEdit = document.getElementById(chkEdit1);
            var chkDelete = document.getElementById(chkDelete);
            var chkPrint = document.getElementById(chkPrint);
            if (ctl == 'All') {
                if (chkMain.checked == true) {
                    chkMain.checked = true;
                    chkNew.checked = true;
                    chkEdit.checked = true;
                    chkDelete.checked = true;
                    chkPrint.checked = true;
                }
                else if (chkMain.checked == false) {
                    chkMain.checked = false;
                    chkNew.checked = false;
                    chkEdit.checked = false;
                    chkDelete.checked = false;
                    chkPrint.checked = false;
                }
            }
            else if (ctl == 'New') {
                if (chkNew.checked == true) {
                    if (chkMain.checked != true) {
                        chkMain.checked = true;
                    }
                }
                else if (chkNew.checked == false && chkEdit.checked == false && chkDelete.checked == false && chkPrint.checked == false) {
                    chkMain.checked = false;
                }
            }
            else if (ctl == 'Edit') {
                if (chkEdit.checked == true) {
                    if (chkMain.checked != true) {
                        chkMain.checked = true;
                    }
                }
                else if (chkNew.checked == false && chkEdit.checked == false && chkDelete.checked == false && chkPrint.checked == false) {
                    chkMain.checked = false;
                }
            }
            else if (ctl == 'Delete') {
                if (chkDelete.checked == true) {
                    if (chkMain.checked != true) {
                        chkMain.checked = true;
                    }
                }
                else if (chkNew.checked == false && chkEdit.checked == false && chkDelete.checked == false && chkPrint.checked == false) {
                    chkMain.checked = false;
                }
            }
            else if (ctl == 'Print') {
                if (chkPrint.checked == true) {
                    if (chkMain.checked != true) {
                        chkMain.checked = true;
                    }
                }
                else if (chkNew.checked == false && chkEdit.checked == false && chkDelete.checked == false && chkPrint.checked == false) {
                    chkMain.checked = false;
                }
            }
        }
        function checkDropdownlist() {
            var ddlGroup = document.getElementById("ddlGroup").selectedIndex;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" EnablePartialRendering="true"
        EnablePageMethods="true" runat="server" />
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div align="center">
                    <asp:HiddenField ID="hidHeading" runat="server" />
                    <asp:HiddenField ID="hidMessage" runat="server" />
                    <table>
                        <tr>
                            <td style="padding-right: 10px">
                                Select Group for Permission:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlGroup" runat="server" CssClass="dropdown" AutoPostBack="true"
                                    OnSelectedIndexChanged="ddlGroup_SelectIndexChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <asp:Panel ID="panelMain" runat="server">
            <%--  <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>   --%>
            <div id="wrapper">
                <ul class="tabs">
                    <li><a href="javascript:void(0)" class="defaulttab" rel="divAccounts">Accounts</a></li>
                    <li><a href="javascript:void(0)" rel="divInvoice">Invoice</a></li>
                    <li><a href="javascript:void(0)" rel="divInventory">Inventory</a></li>
                    <li><a href="javascript:void(0)" rel="divGeneral">General</a></li>
                </ul>
                <div class="tab-content" id="divAccounts" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                        <ContentTemplate>
                            <asp:DataList ID="datalistAccount" runat="server" OnItemDataBound="datalistAccount_ItemDataBound"
                                Width="90%">
                                <HeaderTemplate>
                                    <table style="width: 100%" class="tablecontent" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                &nbsp;
                                            </td>
                                            <td style="width: 50%; font-weight: bold; height: 22px; border-right: solid 1px #818181">
                                                Module Name
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                New
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Edit
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Delete
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center;">
                                                Print
                                            </td>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <table style="height: 22px">
                                        <tr>
                                            <td style="font-weight: bold;">
                                                Module Description:
                                            </td>
                                            <td style="font-weight: bold;">
                                                <asp:Label ID="lblHeading" runat="server" Font-Bold="true" Text='<%#Eval("Modules") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:GridView ID="grdAccount" runat="server" ShowHeader="false" Width="100%" DataKeyNames="MODID"
                                        OnRowDataBound="grdBind_RowDataBound" AutoGenerateColumns="false">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkMain" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <%--<asp:BoundField DataField="MODNAME" ItemStyle-Width="50%" />--%>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblMODNAME" runat="server" Text='<%#Bind("MODNAME")%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkNew" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkEdit" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkDelete" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkPrint" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ItemTemplate>
                            </asp:DataList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div class="tab-content" id="divInvoice" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                        <ContentTemplate>
                            <asp:DataList ID="datalistInvoice" runat="server" OnItemDataBound="datalistInvoice_ItemDataBound"
                                Width="90%">
                                <HeaderTemplate>
                                    <table style="width: 100%" class="tablecontent" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                &nbsp;
                                            </td>
                                            <td style="width: 50%; font-weight: bold; height: 22px; border-right: solid 1px #818181">
                                                Module Name
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                New
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Edit
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Delete
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center;">
                                                Print
                                            </td>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <table style="height: 22px">
                                        <tr>
                                            <td style="font-weight: bold;">
                                                Module Description:
                                            </td>
                                            <td style="font-weight: bold;">
                                                <asp:Label ID="lblHeading" runat="server" Font-Bold="true" Text='<%#Eval("Modules") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:GridView ID="grdInvoice" runat="server" ShowHeader="false" Width="100%" DataKeyNames="MODID"
                                        OnRowDataBound="grdBind_RowDataBound" AutoGenerateColumns="false">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkMain" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <%--<asp:BoundField DataField="MODNAME" ItemStyle-Width="50%" />--%>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblMODNAME" runat="server" Text='<%#Bind("MODNAME")%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkNew" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkEdit" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkDelete" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkPrint" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ItemTemplate>
                            </asp:DataList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div class="tab-content" id="divInventory" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                        <ContentTemplate>
                            <asp:DataList ID="datalistInventory" runat="server" Width="90%" OnItemDataBound="datalistInventory_ItemDataBound">
                                <HeaderTemplate>
                                    <table style="width: 100%" class="tablecontent" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                &nbsp;
                                            </td>
                                            <td style="width: 50%; font-weight: bold; height: 22px; border-right: solid 1px #818181">
                                                Module Name
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                New
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Edit
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Delete
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center;">
                                                Print
                                            </td>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <table style="height: 22px">
                                        <tr>
                                            <td style="font-weight: bold;">
                                                Module Description:
                                            </td>
                                            <td style="font-weight: bold;">
                                                <asp:Label ID="lblHeading" runat="server" Font-Bold="true" Text='<%#Eval("Modules") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:GridView ID="grdInventory" runat="server" ShowHeader="false" Width="100%" DataKeyNames="MODID"
                                        AutoGenerateColumns="false" OnRowDataBound="grdBind_RowDataBound">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkMain" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <%--<asp:BoundField DataField="MODNAME" ItemStyle-Width="50%" />--%>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblMODNAME" runat="server" Text='<%#Bind("MODNAME")%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkNew" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkEdit" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkDelete" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkPrint" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ItemTemplate>
                            </asp:DataList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div class="tab-content" id="divGeneral" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                        <ContentTemplate>
                            <asp:DataList ID="datalistGeneral" runat="server" Width="90%" OnItemDataBound="datalistGeneral_ItemDataBound">
                                <HeaderTemplate>
                                    <table style="width: 100%" class="tablecontent" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                &nbsp;
                                            </td>
                                            <td style="width: 50%; font-weight: bold; height: 22px; border-right: solid 1px #818181">
                                                Module Name
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                New
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Edit
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center; border-right: solid 1px #818181">
                                                Delete
                                            </td>
                                            <td style="width: 10%; font-weight: bold; height: 22px; text-align: center;">
                                                Print
                                            </td>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <table style="height: 22px">
                                        <tr>
                                            <td style="font-weight: bold;">
                                                Module Description:
                                            </td>
                                            <td style="font-weight: bold;">
                                                <asp:Label ID="lblHeading" runat="server" Font-Bold="true" Text='<%#Eval("Modules") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:GridView ID="grdGeneral" runat="server" ShowHeader="false" Width="100%" DataKeyNames="MODID"
                                        AutoGenerateColumns="false" OnRowDataBound="grdBind_RowDataBound">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkMain" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <%--<asp:BoundField DataField="MODNAME" ItemStyle-Width="50%" />--%>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblMODNAME" runat="server" Text='<%#Bind("MODNAME")%>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkNew" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkEdit" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkDelete" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkPrint" runat="server" />
                                                </ItemTemplate>
                                                <ItemStyle Width="10%" HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </ItemTemplate>
                            </asp:DataList>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <%--  </ContentTemplate>
     </asp:UpdatePanel>  --%>
        </asp:Panel>
        <div style="width: 100%; text-align: center; margin-top: 10px">
            <asp:Button ID="btnSubmit" runat="server" Text="Save" CssClass="button" OnClick="btnSubmit_Click" />&nbsp;
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="button" OnClick="btnCancel_Click" />
        </div>
    </div>
    </form>
</body>
</html>
